#include "tests.h"
-#include "simple_getline.h"
int main(int argc, char **argv)
{
char buf[8192];
- size_t bufsize = 0;
FILE *f = argc > 1 ? fopen(argv[1], "r") : NULL;
utf8proc_uint8_t src[1024];
int len;
#include "tests.h"
-#include "simple_getline.h"
#define CHECK_NORM(NRM, norm, src) { \
char *src_norm = (char*) utf8proc_ ## NRM((utf8proc_uint8_t*) src); \
+++ /dev/null
-/* simplistic, portable replacement for getline, sufficient for our tests */
-static size_t simple_getline(char buf[8192], FILE *f) {
- size_t i = 0;
- while (i < 1023) {
- int c = getc(f);
- if (c == EOF || c == '\n') break;
- buf[i++] = (char) c;
- }
- buf[i] = 0;
- return i;
-}
d += utf8proc_encode_char(c, (utf8proc_uint8_t *) (dest + d));
}
}
+
+/* simplistic, portable replacement for getline, sufficient for our tests */
+size_t simple_getline(char buf[8192], FILE *f) {
+ size_t i = 0;
+ while (i < 1023) {
+ int c = getc(f);
+ if (c == EOF || c == '\n') break;
+ buf[i++] = (char) c;
+ }
+ buf[i] = 0;
+ return i;
+}
void check(int cond, const char *format, ...);
size_t skipspaces(const char *buf, size_t i);
size_t encode(char *dest, const char *buf);
+size_t simple_getline(char buf[8192], FILE *f);